#-*- coding: utf-8 -*-
'''
Created on 20 сент. 2010

@author: ivan
'''
from google.appengine.ext import db

class ArticleModel(db.Model):
    author = db.UserProperty()
    title = db.StringProperty(multiline=False)
    title_eng = db.StringProperty(multiline=False)
    title_translit = db.StringProperty(multiline=False)
    content = db.TextProperty()
    content_eng = db.TextProperty()
    keywords = db.StringProperty(multiline=False)
    date = db.DateTimeProperty(auto_now_add=True)
    category = db.StringProperty(required=False)
    visible = db.StringProperty(required=False)

class VersoinModel(db.Model):
    version = db.StringProperty(multiline=False)
    date = db.DateTimeProperty(auto_now_add=True) 
    
class StatisticModel(db.Model):
    userUUID = db.StringProperty(multiline=False)
    host = db.StringProperty(multiline=False)
    date = db.DateProperty(auto_now_add=True)
    v = db.StringProperty(multiline=False)

class CommonStatisticModel(db.Model):    
    date = db.DateProperty(auto_now_add=True)
    count = db.IntegerProperty(default=1)    
    
class CommentModel(db.Model):
    date = db.DateTimeProperty(auto_now_add=True)
    name = db.StringProperty(multiline=False)
    site = db.StringProperty(multiline=False)
    comment = db.TextProperty()
    comment_eng = db.TextProperty()
    article = db.ReferenceProperty(ArticleModel)
    user_id = db.StringProperty(multiline=False)   

